package com.goudan.mybatisplus.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@Api(tags = {"Swagger学习控制器"})
public class SwaggerController {

    @ApiOperation(value = "post方法，执行数据新增！",notes = "Swagger学习使用-处理POST请求的方法")
    @PostMapping("/post")
    public String post() {
        return "post";
    }

    @ApiOperation(value = "get方法，执行数据新增！",notes = "Swagger学习使用-处理GET请求的方法")
    @GetMapping("/get")
    public String get(@ApiParam(value = "用户新增时提供的用户名") String name,
                      @ApiParam(value = "用户新增时提供的密码") String password) {

        return "get";
    }

    @ApiIgnore
    @RequestMapping("/req")
    public String req(String m) {
        return "req";
    }
}

